package com.lixin.smartclassroom.ui.home.adapter;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 95683
 * @Description:
 * @date 2022/12/8 21:44
 */
public class PagerAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments=new ArrayList<>();
    private List<String> mTitle = new ArrayList<>();
    private List<Integer> bookCountList = new ArrayList<>();
    private String content;
    public PagerAdapter(FragmentManager fm, List<Fragment> fragments, List<String> mTitle) {
        super(fm);
        this.fragments=fragments;
        this.mTitle=mTitle;
    }

    public PagerAdapter(FragmentManager fm, List<Fragment> fragments, List<String> mTitle, List<Integer> bookCountList) {
        super(fm);
        this.fragments=fragments;
        this.mTitle=mTitle;
        this.bookCountList = bookCountList;
    }



    public PagerAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        this.fragments=fragments;
    }
    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitle.get(position);
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }
}

